<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        * {
            padding: 0;
            margin: 0;
        }

        img {
            width: 50px;
            height: 50px;
            position: fixed;
            left: 0;
            top: 0;
        }
    </style>


</head>

<body>
    <img class="imgBox" src="./icon.jpg" alt="">


    <script src="./jquery/jquery-3.6.0.min.js"></script>
    <script>

        document.onmousemove = function (e) {
            var x = e.clientX + "px";
            var y = e.clientY + "px";
            console.log(x, y);
            $('.imgBox').css("left",x)
            $('.imgBox').css("top",y)
            console.log($(".imgBox"));

        }

    </script>
</body>

</html>